package com.sens.tables;

import com.litesuits.orm.db.annotation.Column;
import com.sens.database.LiteOrmDBUtil;

public abstract class BaseOrder<T extends BaseOrder> extends LiteOrmDBUtil.BaseTable<T> {
    @Column("hasUpload")
    private boolean hasUpload;
    @Column("hasUploadLog")
    private boolean hasUploadLog;
    @Column("queryKey")
    private String queryKey;

    public boolean isHasUpload() {
        return hasUpload;
    }

    public void setHasUpload(boolean hasUpload) {
        this.hasUpload = hasUpload;
    }

    public boolean isHasUploadLog() {
        return hasUploadLog;
    }

    public void setHasUploadLog(boolean hasUploadLog) {
        if (this.hasUpload == hasUpload) return;
        this.hasUpload = hasUpload;
        this.queryKey = requestQueryKey();
        if (hasUpload) {
            this.queryKey = "已上传" + this.queryKey;
        } else {
            this.queryKey = "未上传" + this.queryKey;
        }
    }

    public String getQueryKey() {
        if (queryKey == null) queryKey = requestQueryKey();
        return queryKey;
    }

    public abstract String requestQueryKey();
}
